package com.liuzh.deviceinfo.tests;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.FontMetrics;
import android.graphics.Paint.Join;
import android.graphics.Paint.Style;
import android.graphics.PointF;
import android.util.SparseArray;
import android.view.View;
import c.h.a.m0.h;

public class MultiTouchView extends View {
    public Paint a = new Paint(1);
    public SparseArray<PointF> b = new SparseArray();
    public Paint c = new Paint(1);
    public SparseArray<PointF> d = new SparseArray();
    public int e = 0;
    public String f;
    public String g;
    public float h;
    public PointF i;

    public MultiTouchView(Context context) {
        super(context);
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getResources().getString(2131690067));
        String str = ": 0";
        stringBuilder.append(str);
        this.f = stringBuilder.toString();
        stringBuilder = new StringBuilder();
        stringBuilder.append(getResources().getString(2131689773));
        stringBuilder.append(str);
        this.g = stringBuilder.toString();
        this.i = new PointF();
        setBackgroundColor(-16777216);
        this.a.setStyle(Style.FILL);
        this.a.setColor(-1);
        this.a.setStrokeWidth((float) h.t(50.0f, getResources().getDisplayMetrics()));
        this.a.setStrokeCap(Cap.ROUND);
        this.a.setStrokeJoin(Join.ROUND);
        this.c.setTextSize(40.0f);
        this.c.setColor(-1);
        FontMetrics fontMetrics = this.c.getFontMetrics();
        this.h = fontMetrics.bottom - fontMetrics.top;
        this.i.x = (float) h.t(42.0f, getResources().getDisplayMetrics());
        PointF pointF = this.i;
        pointF.y = pointF.x;
    }

    public void onDraw(Canvas canvas) {
        PointF pointF;
        for (int i = 0; i < this.b.size(); i++) {
            pointF = (PointF) this.b.valueAt(i);
            canvas.drawPoint(pointF.x, pointF.y, this.a);
        }
        String str = this.f;
        pointF = this.i;
        canvas.drawText(str, pointF.x, pointF.y, this.c);
        str = this.g;
        pointF = this.i;
        canvas.drawText(str, pointF.x, pointF.y + this.h, this.c);
    }

    /* JADX WARNING: Missing block: B:8:0x0017, code skipped:
            if (r1 != 6) goto L_0x010c;
     */
    @android.annotation.SuppressLint({"ClickableViewAccessibility"})
    public boolean onTouchEvent(android.view.MotionEvent r9) {
        /*
        r8 = this;
        r0 = "test_multitouch";
        r1 = r9.getActionMasked();
        r2 = 2131689773; // 0x7f0f012d float:1.900857E38 double:1.0531946844E-314;
        r3 = ": ";
        r4 = 1;
        if (r1 == 0) goto L_0x0076;
    L_0x000e:
        if (r1 == r4) goto L_0x0042;
    L_0x0010:
        r5 = 2;
        if (r1 == r5) goto L_0x001b;
    L_0x0013:
        r5 = 5;
        if (r1 == r5) goto L_0x007b;
    L_0x0016:
        r0 = 6;
        if (r1 == r0) goto L_0x0042;
    L_0x0019:
        goto L_0x010c;
    L_0x001b:
        r0 = 0;
    L_0x001c:
        r1 = r9.getPointerCount();	 Catch:{ Exception -> 0x003d }
        if (r0 >= r1) goto L_0x003d;
    L_0x0022:
        r1 = r9.getPointerId(r0);	 Catch:{ Exception -> 0x003d }
        r2 = r8.b;	 Catch:{ Exception -> 0x003d }
        r1 = r2.get(r1);	 Catch:{ Exception -> 0x003d }
        r1 = (android.graphics.PointF) r1;	 Catch:{ Exception -> 0x003d }
        r2 = r9.getX(r0);	 Catch:{ Exception -> 0x003d }
        r1.x = r2;	 Catch:{ Exception -> 0x003d }
        r2 = r9.getY(r0);	 Catch:{ Exception -> 0x003d }
        r1.y = r2;	 Catch:{ Exception -> 0x003d }
        r0 = r0 + 1;
        goto L_0x001c;
    L_0x003d:
        r8.invalidate();
        goto L_0x010c;
    L_0x0042:
        r0 = r9.getActionIndex();	 Catch:{ Exception -> 0x004f }
        r9 = r9.getPointerId(r0);	 Catch:{ Exception -> 0x004f }
        r0 = r8.d;	 Catch:{ Exception -> 0x004f }
        r0.remove(r9);	 Catch:{ Exception -> 0x004f }
    L_0x004f:
        r9 = new java.lang.StringBuilder;
        r9.<init>();
        r0 = r8.getResources();
        r0 = r0.getString(r2);
        r9.append(r0);
        r9.append(r3);
        r0 = r8.d;
        r0 = r0.size();
        r9.append(r0);
        r9 = r9.toString();
        r8.g = r9;
        r8.invalidate();
        goto L_0x010c;
    L_0x0076:
        r1 = r8.b;
        r1.clear();
    L_0x007b:
        r1 = r9.getActionIndex();	 Catch:{ Exception -> 0x0109 }
        r5 = r9.getPointerId(r1);	 Catch:{ Exception -> 0x0109 }
        r6 = new android.graphics.PointF;	 Catch:{ Exception -> 0x0109 }
        r7 = r9.getX(r1);	 Catch:{ Exception -> 0x0109 }
        r9 = r9.getY(r1);	 Catch:{ Exception -> 0x0109 }
        r6.<init>(r7, r9);	 Catch:{ Exception -> 0x0109 }
        r9 = r8.b;	 Catch:{ Exception -> 0x0109 }
        r9.append(r5, r6);	 Catch:{ Exception -> 0x0109 }
        r9 = r8.d;	 Catch:{ Exception -> 0x0109 }
        r9.append(r5, r6);	 Catch:{ Exception -> 0x0109 }
        r9 = r8.e;	 Catch:{ Exception -> 0x0109 }
        r1 = r8.b;	 Catch:{ Exception -> 0x0109 }
        r1 = r1.size();	 Catch:{ Exception -> 0x0109 }
        if (r9 >= r1) goto L_0x00ac;
    L_0x00a4:
        r9 = r8.b;	 Catch:{ Exception -> 0x0109 }
        r9 = r9.size();	 Catch:{ Exception -> 0x0109 }
        r8.e = r9;	 Catch:{ Exception -> 0x0109 }
    L_0x00ac:
        r9 = new java.lang.StringBuilder;	 Catch:{ Exception -> 0x0109 }
        r9.<init>();	 Catch:{ Exception -> 0x0109 }
        r1 = r8.getResources();	 Catch:{ Exception -> 0x0109 }
        r5 = 2131690067; // 0x7f0f0253 float:1.9009167E38 double:1.0531948297E-314;
        r1 = r1.getString(r5);	 Catch:{ Exception -> 0x0109 }
        r9.append(r1);	 Catch:{ Exception -> 0x0109 }
        r9.append(r3);	 Catch:{ Exception -> 0x0109 }
        r1 = r8.e;	 Catch:{ Exception -> 0x0109 }
        r9.append(r1);	 Catch:{ Exception -> 0x0109 }
        r9 = r9.toString();	 Catch:{ Exception -> 0x0109 }
        r8.f = r9;	 Catch:{ Exception -> 0x0109 }
        r9 = new java.lang.StringBuilder;	 Catch:{ Exception -> 0x0109 }
        r9.<init>();	 Catch:{ Exception -> 0x0109 }
        r1 = r8.getResources();	 Catch:{ Exception -> 0x0109 }
        r1 = r1.getString(r2);	 Catch:{ Exception -> 0x0109 }
        r9.append(r1);	 Catch:{ Exception -> 0x0109 }
        r9.append(r3);	 Catch:{ Exception -> 0x0109 }
        r1 = r8.d;	 Catch:{ Exception -> 0x0109 }
        r1 = r1.size();	 Catch:{ Exception -> 0x0109 }
        r9.append(r1);	 Catch:{ Exception -> 0x0109 }
        r9 = r9.toString();	 Catch:{ Exception -> 0x0109 }
        r8.g = r9;	 Catch:{ Exception -> 0x0109 }
        r9 = c.h.a.m0.o.b;	 Catch:{ Exception -> 0x0109 }
        r1 = r9.a;	 Catch:{ Exception -> 0x0109 }
        r2 = -1;
        r1 = r1.getInt(r0, r2);	 Catch:{ Exception -> 0x0109 }
        r2 = r8.e;	 Catch:{ Exception -> 0x0109 }
        if (r1 >= r2) goto L_0x0109;
    L_0x00fc:
        r9 = r9.a;	 Catch:{ Exception -> 0x0109 }
        r9 = r9.edit();	 Catch:{ Exception -> 0x0109 }
        r9 = r9.putInt(r0, r2);	 Catch:{ Exception -> 0x0109 }
        r9.apply();	 Catch:{ Exception -> 0x0109 }
    L_0x0109:
        r8.invalidate();
    L_0x010c:
        return r4;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.liuzh.deviceinfo.tests.MultiTouchView.onTouchEvent(android.view.MotionEvent):boolean");
    }
}
